package com.landlord.project;

public class LandlordData implements Comparable{
    //面值     13:小王     14:大王
    private int value;
    //花色     ♠     ♥     ♦     ♣
    private char color;
    //状态
    private boolean state;
    //属性     0:玩家一     1:玩家二     2:玩家三     3:地主牌
    private int mode;

    public LandlordData(int value, char color, boolean state, int mode) {
        this.value = value;
        this.color = color;
        this.state = state;
        this.mode = mode;
    }

    public int getValue() {
        return value;
    }

    public boolean isState() {
        return state;
    }

    public void setState(boolean state) {
        this.state = state;
    }

    public int getMode() {
        return mode;
    }

    @Override
    public String toString(){
        return LandlordView.getStr(value);
    }

    public String getToString() {
        String valstr = LandlordView.getStr(value);
        String modestr;
        if (mode==0){
            modestr = "玩家一";
        }else if (mode==1){
            modestr = "玩家二";
        }else if (mode==2){
            modestr = "玩家三";
        }else {
            modestr = "地主牌";
        }
        return "LandlordsData{" +
                "面值:" + valstr +
                ", 花色:" + color +
                ", 状态:" + state +
                ", 属性:" + modestr +
                '}';
    }

    //自然排序
    @Override
    public int compareTo(Object o) {
        LandlordData ld = (LandlordData)o;
        return -Integer.compare(value,ld.value);
    }
}

/*文档
王炸   A
炸弹   A         Y[0-12]
顺子   B X[5-12] Y[0-7]
连对   C X[3-10] Y[0~9]
飞机   D X[2-6]  Y[0~10]
飞机翅 E X[2-5]  Y[0~10]
飞机对 F X[2-4]  Y[0~10]
三带对 G         Y[0-12]
三带一 H         Y[0-12]
三单   I         Y[0-12]
对子   J         Y[0-12]
单     K         Y[0-14]
四带二 L         Y[0-12]
四两对 M         Y[0-12]
不合法 X

XX数量
YY权值(均按最小值)
*/